package ar.edu.unlu.sistemas.ws.business;

import java.util.Hashtable;

import org.ksoap2.serialization.KvmSerializable;
import org.ksoap2.serialization.PropertyInfo;

public class RatingWS  implements KvmSerializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -4672509687769204203L;
	PeerWS peer;
	Float rating;
	
	public RatingWS() {
		super();
	}
	public PeerWS getPeer() {
		return peer;
	}
	public void setPeer(PeerWS peer) {
		this.peer = peer;
	}
	public Float getRating() {
		return rating;
	}
	public void setRating(Float rating) {
		this.rating = rating;
	}
	@Override
	public Object getProperty(int arg0) {
		switch (arg0) {
		case 0:
			return this.getPeer();
		case 1:
			return this.getRating();
		default:
			return null;	
		}
	}
	@Override
	public int getPropertyCount() {
		return 2;
	}
	@Override
	public void getPropertyInfo(int arg0, Hashtable arg1, PropertyInfo arg2) {
		switch (arg0) {
			case 0:
				arg2.setName("peer");
				arg2.setType(PeerWS.class);
				break;
			case 1:
				arg2.setName("rating");
				arg2.setType(Float.class);
				break;
		}
		
	}
	@Override
	public void setProperty(int arg0, Object arg1) {
		switch (arg0) {
		case 0:
			this.setPeer((PeerWS)arg1);
			break;
		case 1:
			this.setRating((Float)arg1);
			break;
	}
		
	}
	@Override
	public String toString() {
		return "RatingWS [peer=" + peer.toString() + ", rating=" + rating + "]";
	}
	
}